/*
 *    Copyright (c) 2018-2025, bfcloud All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: bfcloud
 */

import request from '@/router/axios'

// 创建查询列表
export function pfhzbmhzList(query) {
  return request({
    url: `/appr-event/pfhzbmhz/page`,
    method: 'get',
    params: query
  })
}

// 创建查询列表
export function pfhzsearchList(query) {
  return request({
    url: `/appr-event/pfhzsearch/page`,
    method: 'get',
    params: query
  })
}


// 创建查询列表
export function leaderpage(query) {
  return request({
    url: `/appr-event/pfhzbmhz/leaderpage`,
    method: 'get',
    params: query
  })
}

// 创建查询列表
export function pfhzbmhzList2(query) {
  return request({
    url: `/appr-event/pfhzbmhz/examinePage`,
    method: 'get',
    params: query
  })
}
// 新增
export function addPfhzbmhz(obj) {
  return request({
    url: '/appr-event/pfhzbmhz',
    method: 'post',
    data: obj
  })
}

export function getName(id) {
  return request({
    url: `/appr-event/pfhzhzzq/${id}`,
    method: 'get'
  })
}

//部门集合
export function getSysDeptDtoList(zid) {
  return request({
    url: `/appr-event/pfhzbmhzmx/getSysDeptDtoList/${zid}`,
    method: 'get'
  })
}

//岗位集合
export function getGwmcDtoList(zid) {
  return request({
    url: `/appr-event/pfhzbmhzmx/getGwmcDtoList/${zid}`,
    method: 'get'
  })
}

//部门集合
export function getSysDeptDtoListByHzid(zid) {
  return request({
    url: `/appr-event/pfhzbmhzmx/getSysDeptDtoListByHzid/${zid}`,
    method: 'get'
  })
}

//岗位集合
export function getGwmcDtoListByHzid(zid) {
  return request({
    url: `/appr-event/pfhzbmhzmx/getGwmcDtoListByHzid/${zid}`,
    method: 'get'
  })
}
//列表集合
export function getBmhzmxByZid(zid) {
  return request({
    url: `/appr-event/pfhzbmhzmx/getBmhzmxByZid/${zid}`,
    method: 'get'
  })
}

export function getMxListQuery(query,zid) {
  return request({
    url: `/appr-event/pfhzbmhzmx/getMxListQuery/${zid}`,
    method: 'get',
    params: query
  })
}
//保存子表
export function submitBmhzMx(data,zid) {
  return request({
    url: `/appr-event/pfhzbmhzmx/submitBmhzMx/${zid}`,
    method: 'put',
    data: data,
  })
}
//保存子表
export function submitAllMxList(data) {
  return request({
    url: `/appr-event/pfhzbmhzmx/submitAllMxList`,
    method: 'put',
    data: data,
  })
}


//保存子表
export function submitGrade(data) {
  return request({
    url: `/appr-event/pfhzbmhzmx/submitGrade`,
    method: 'put',
    data: data,
  })
}

export function getHzzq(query) {
  return request({
    url: '/appr-event/pfhzhzzq/getHzzq',
    method: 'get',
    params: query
  })
}

export function submitBmry(query) {
  return request({
    url: `/appr-event/pfhzbmhzmx/submitBmry`,
    method: 'post',
    data: query,
  })
}

export function submitBm(query) {
  return request({
    url: `/appr-event/pfhzbmhzmx/submitBm`,
    method: 'post',
    data: query,
  })
}


//old
// 机构列表展示
export function showJgTree1(query) {
  return request({
    url: '/appr-event/routineAssessKpi/getKpiTree',
    method: 'get',
    params: query
  })
}

//new
// 机构列表展示
export function showJgTree2(query) {
  return request({
    url: '/appr-event/rckhtemplatemain/getPfDept',
    method: 'get',
    params: query
  })
}
//all
// 机构列表展示
export function showJgTreeAll(query) {
  return request({
    url: '/appr-event/rckhtemplatemain/alltree',
    method: 'get',
    params: query
  })
}
//删除
export function deleteScore(ids) {
  return request({
    url: `/appr-event/pfhzbmhzmx/${ids}`,
    method: 'delete',
  })
}
// 修改
export function updatePfhzbmhz(obj) {
  return request({
    url: '/appr-event/pfhzbmhz',
    method: 'put',
    data: obj
  })
}


export function isAllScore(zid) {
  return request({
    url: `/appr-event/pfhzbmhzmx/isAllScore/${zid}`,
    method: 'get'
  })
}

export function isAllPfdj(ids) {
  return request({
    url: `/appr-event/pfhzbmhzmx/isAllPfdj/${ids}`,
    method: 'get'
  })
}

export function submitDeptExamine(query) {
  return request({
    url: `/appr-event/pfhzbmhz/submitDeptExamine`,
    method: 'post',
    data: query,
  })
}
// 提交
export function deptLeaderSubmit(query) {
  return request({
    url: '/appr-event/pfhzbmhz/deptLeaderSubmit',
    method: 'post',
    data: query
  })
}


//导出
export function exportExcel(query) {
  return request({
    url: '/appr-event/pfhzbmhz/exportExcel',
    method: 'post',
    params: query,
    responseType: 'blob'
  })
}


export function getNodeInfo(proId) {
  return request({
    url: '/appr-event/pfhzbmhz/getCurrentTask/' + proId,
    method: 'get'
  })
}

export function getByHzzq(hzzqId) {
  return request({
    url: `/appr-event/pfhzbmhzmx/getByHzzq/${hzzqId}`,
    method: 'get'
  })
}

//主表删除
export function deleteZbmhz(ids) {
  return request({
    url: `/appr-event/pfhzbmhz/${ids}`,
    method: 'delete',
  })
}
// 提交
export function deptLeaderSubmitById(query) {
  return request({
    url: '/appr-event/pfhzbmhz/deptLeaderSubmitById',
    method: 'post',
    data: query
  })
}


export function getPageByHzzq(query,hzzqId,type) {
  return request({
    url: `/appr-event/pfhzbmhzmx/getByHzzq/${hzzqId}/${type}`,
    method: 'get',
    params: query
  })
}

//
export function vailBmUser(zid,userid) {
  return request({
    url: `/appr-event/pfhzbmhzmx/vailBmUser/${zid}/${userid}`,
    method: 'get'
  })
}


//保存子表
export function submitLeaderGrade(data) {
  return request({
    url: `/appr-event/pfhzbmhzmx/submitLeaderGrade`,
    method: 'put',
    data: data,
  })
}
